Iterating through deleted and undeleted objects

Hi,

So everyone knows this formula:

for o in m {...}

What I want is for o to not skip deleted items.  I want to go through every object in a module, whether they are deleted or not.  

I then need two things from each and every object: their absolute number and whether they are a deleted object or not.  To get the latter piece of information, could I use the function isDeleted?

Thanks,

Grasswistle


grasswistle - Fri Nov 08 14:47:05 EST 2013

Re: Iterating through deleted and undeleted objects
EHcnck - Fri Nov 08 21:20:48 EST 2013

Module currMod = current
Object o       = null
for o in entire currMod do {
    print probeAttr_(o, "Absolute Number") "\t" isDeleted(o) "\n"
}

Re: Iterating through deleted and undeleted objects
llandale - Mon Nov 11 13:41:10 EST 2013

EHcnck - Fri Nov 08 21:20:48 EST 2013

Module currMod = current
Object o       = null
for o in entire currMod do {
    print probeAttr_(o, "Absolute Number") "\t" isDeleted(o) "\n"
}

Yes.  I rarely if ever use the "for o in m do" loop as it is at the mercy of the fickle current view settings; filtering, levels, showing deleted objects, bla bla bla.  My object loops almost aways look like this:

  • for o in entire m do
  • {  if (isDeleted(o))   then continue
  •    if (ForSomeOtherReasonDisqualified(o))  then continue
  •    DealWith(o)
  • }

-Louie